package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.Attendance;
import cn.wolfcode.crm.domain.SystemLog;
import cn.wolfcode.crm.mapper.AttendanceMapper;
import cn.wolfcode.crm.mapper.SystemLogMapper;
import cn.wolfcode.crm.page.PageResult;
import cn.wolfcode.crm.query.AttendanceQueryObject;
import cn.wolfcode.crm.service.IAttendanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AttendanceServiceImpl implements IAttendanceService {

    @Autowired
    private AttendanceMapper attendanceMapper;
    public PageResult query(AttendanceQueryObject qo) {

        int total = attendanceMapper.queryForCount(qo);

        if (total==0){
            return new PageResult();
        }
        List<Attendance> list = attendanceMapper.queryForList(qo);
        return new PageResult(total,list);
    }
}
